package com.neulogistics.contrib.procuredcenter.infrastructure.persistence.orm.po;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import lombok.Data;

/**
 * 商品一级分类表
 * @TableName tb_goodslist
 */
@TableName(value ="tb_goodslist")
@Data
public class GoodsListPO implements Serializable {
    /**
     * id
     */
    @TableId(value = "list_id", type = IdType.AUTO)
    private Integer listId;

    /**
     * 一级分类名
     */
    @TableField(value = "list_name", condition = SqlCondition.LIKE)
    private String listName;

    /**
     * 一级分类描述
     */
    @TableField(value = "list_description")
    private String listDescription;

    /**
     * 是否删除
     */
    @TableField(value = "deleted")
    @TableLogic(value = "0", delval = "1")
    private Integer deleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GoodsListPO other = (GoodsListPO) that;
        return (this.getListId() == null ? other.getListId() == null : this.getListId().equals(other.getListId()))
            && (this.getListName() == null ? other.getListName() == null : this.getListName().equals(other.getListName()))
            && (this.getListDescription() == null ? other.getListDescription() == null : this.getListDescription().equals(other.getListDescription()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getListId() == null) ? 0 : getListId().hashCode());
        result = prime * result + ((getListName() == null) ? 0 : getListName().hashCode());
        result = prime * result + ((getListDescription() == null) ? 0 : getListDescription().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", listId=").append(listId);
        sb.append(", listName=").append(listName);
        sb.append(", listDescription=").append(listDescription);
        sb.append(", deleted=").append(deleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}